<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">


<div class="table-responsive">
    <table class="table table-bordered">
        <thead>
        <tr>
            <th class="text-center">
                <div class="table-first-id">ID</div>
            </th>
            <th class="text-center" width="10%">作业名称</th>
            <th class="text-center" width="19%">隶属专业/隶属科目</th>
            <th class="text-center" width="10%">关联课程</th>
            <th class="text-center" width="15%">关联班级</th>
            <th class="text-center" width="10%">作业类型</th>
            <th class="text-center" width="9%">最晚提交时间</th>
            <th class="text-center" width="9%">创建人</th>
            <th class="text-center" width="5%">状态</th>
            <th class="text-center" width="8%">操作</th>
        </tr>
        </thead>
    </table>
    <div class="J_V_tabContent table-xScrollWrap">
        <table class="table table-bordered table-hover table-xs-content">
            <tbody id="tbodyMaterial">
            <tr class="jqgfirstrow" role="row">
                <td class="text-center">
                    <div class="table-first-id"></div>
                </td>
                <td class="text-center" width="10%">&nbsp;</td>
                <td class="text-center" width="19%">&nbsp;</td>
                <td class="text-center" width="10%">&nbsp;</td>
                <td class="text-center" width="15%">&nbsp;</td>
                <td class="text-center" width="10%">&nbsp;</td>
                <td class="text-center" width="9%">&nbsp;</td>
                <td class="text-center" width="9%">&nbsp;</td>
                <td class="text-center" width="5%">&nbsp;</td>
                <td class="text-center" width="8%">&nbsp;</td>
            </tr>
            <tr th:if="${#maps.isEmpty(dataMap)} or ${#lists.isEmpty(dataMap['list'])}">
                <td colspan="10" class="text-center">
                <div class="noDataTipsBox">
                    <p><span class="c-4e fs16">还没有作业~~~</span></p>
                </div>
                </td>
            </tr>

            <tr th:each="task : ${dataMap['list']}" th:attrappend="data-id=${task['id']}">
                <td class="text-center">
                    <input type="checkbox" class="i-checks" name="id" th:value="${task['id']}">
                </td>
                <td class="text-center"  th:utext="${task['name']}"></td>
                <td class="text-center">
                    <th:block th:if="!${#lists.isEmpty(task['subjectList'])}">
                        <span class="pie" th:each="subject,subIndex : ${task['subjectList']}">
                            <th:block th:text="${subject['subjectName']}+'/'"></th:block>
                            <th:block th:if="!${#lists.isEmpty(subject['childSubjectList'])}" th:each="child,index : ${subject['childSubjectList']}">
                                <th:block th:if="${index.last} == false" th:text="${child['subjectName']}+'/'"></th:block>
                                <th:block th:if="${index.last} == true" th:text="${child['subjectName']}"></th:block>
                            </th:block>
                            <th:block th:if="${#lists.isEmpty(subject['childSubjectList'])}">全部科目</th:block>
                            <th:block th:if="${subIndex.last}==false" th:utext="'<br/>'"></th:block>
                        </span>
                    </th:block>
                    <th:block th:if="${#lists.isEmpty(task['subjectList'])}">
                        <span class="pie">—</span>
                    </th:block>
                </td>
                <td class="text-center">
                    <span th:if="!${#lists.isEmpty(task['courseList'])}" th:each="course, index : ${task['courseList']}" th:text="${index.index < index.size - 1} ? ${course.courseName} + '/' : ${course.courseName}"></span>
                    <span th:if="${#lists.isEmpty(task['courseList'])}"> —</span>
                </td>
                <td class="text-center">
                    <span th:if="!${#lists.isEmpty(task['classesList'])}" th:each="classes, index : ${task['classesList']}" th:text="${index.index < index.size - 1} ? ${classes.name} + '/' : ${classes.name}"></span>
                    <span th:if="${#lists.isEmpty(task['classesList'])}"> —</span>
                </td>
                <td class="text-center" th:text="${task['examType']['name']}"></td>
                <td class="text-center">
                    <span th:if="${task['endTime'] == null}">—</span>
                    <span th:if="${task['endTime'] != null}" th:text="${#strings.substring(task['endTime'],0,16)}"></span>
                </td>
                <td class="text-center" th:text="${task['createUser']['ralName']}"></td>
                <td class="text-center" data-status>
                    <span class="label label-default label-default-info" th:if="${task['status']} == 0">未发布</span>
                    <span class="label label-info" th:if="${task['status']} == 1">已发布</span>
                    <span class="label label-danger" th:if="${task['status']} == 2">已禁用</span>
                </td>
                <td class="text-center">
                    <a href="javascript:void(0)" th:data-id="${task['id']}" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="作业情况"><i class="fa fa-bar-chart"></i></a>
                    <a th:href="@{/admin/examination/paper/previewTask?examId={id}(id=${task['id']})}" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="查看"><i class="fa fa-eye"></i></a>
                    <a th:if="${task['status']} != 2" th:href="@{/admin/examination/paper/initUpdateTask?id={id}(id=${task['id']})}" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="编辑"><i class="fa fa-edit"></i></a>
                    <a th:if="${task['status']} == 0" href="javascript:void(0)" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="发布"><i class="fa fa-arrow-up"></i></a>
                    <a th:if="${task['status']} == 1" href="javascript:void(0)" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="禁用"><i class="fa fa-unlock-alt"></i></a>
                    <a th:if="${task['status']} == 2" href="javascript:void(0)" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="恢复"><i class="fa fa-history"></i></a>
                    <a th:if="${task['status']} == 0" href="javascript:void(0)" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="删除"><i class="fa fa-trash"></i></a>
                </td>
            </tr>
            </tbody>
        </table>
    </div>

    <!-- 分页，开始 -->
    <div data-th-replace="layout/adminPage"></div>
    <!-- 分页，结束 -->
</div>

</html>
